
#include "BallGame.h"

bool BallGame::onInit(){

	if( SDL_Init(SDL_INIT_EVERYTHING) < 0 )
		return false;

	if( TTF_Init() < 0 )
		return false;

	if( Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096) < 0 )
		return false;

	if( (displaySurface = SDL_SetVideoMode(WND_WIDTH, WND_HEIGHT, 16, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL )
		return false;

	if(!initTexts())
		return false;

	if(!level.onInit())
		return false;

	if(!initImages())
		return false;

	if(!initSounds())
		return false;

	SDL_EnableKeyRepeat(1,SDL_DEFAULT_REPEAT_INTERVAL / 3);

	return true;
}